package pub.developers.forum.api.service;

import pub.developers.forum.api.model.PageRequestModel;
import pub.developers.forum.api.model.PageResponseModel;
import pub.developers.forum.api.model.ResultModel;
import pub.developers.forum.api.request.AdminBooleanRequest;
import pub.developers.forum.api.request.article.ArticleInformRequest;
import pub.developers.forum.api.request.user.*;
import pub.developers.forum.api.response.article.ArticleLoveResponse;
import pub.developers.forum.api.response.follow.commentFollowResponse;
import pub.developers.forum.api.response.follow.postsFollowResponse;
import pub.developers.forum.api.response.user.UserInfoResponse;
import pub.developers.forum.api.response.user.UserOptLogPageResponse;
import pub.developers.forum.api.response.user.UserPageResponse;

import java.io.UnsupportedEncodingException;
import java.util.List;

public interface UserApiService {

    ResultModel enable(Long uid);

    ResultModel disable(Long uid);

    ResultModel follow(Long followed) throws Exception;

    ResultModel cancelFollow(Long followed) throws Exception;


    ResultModel<PageResponseModel<UserPageResponse>> pageFollower(PageRequestModel<Long> pageRequestModel);

    ResultModel<PageResponseModel<UserPageResponse>> pageFans(PageRequestModel<Long> pageRequestModel);

    ResultModel<Boolean> hasFollow(Long followed);

    ResultModel<UserInfoResponse> info(String token);

    ResultModel<UserInfoResponse> info(Long uid);

    ResultModel<String> register(UserRegisterRequest request) throws Exception;


    ResultModel<String> emailLogin(UserEmailLoginRequest request) throws Exception;

    ResultModel<String> wxLogin(String openid) throws Exception;

    ResultModel<String> wxLogin(UserWxLoginRequest request) throws Exception;

    ResultModel logout(UserTokenLogoutRequest request) throws Exception;

    ResultModel signOut();

    ResultModel updateInfo(UserUpdateInfoRequest request) throws UnsupportedEncodingException;

    ResultModel updateHeadImg(String linkFilenameData);

    ResultModel updatePwd(UserUpdatePwdRequest request);

    ResultModel<PageResponseModel<UserPageResponse>> adminPage(PageRequestModel<UserAdminPageRequest> pageRequestModel);

    ResultModel<PageResponseModel<UserPageResponse>> pageActive(PageRequestModel pageRequestModel);

    ResultModel<PageResponseModel<UserOptLogPageResponse>> pageOptLog(PageRequestModel<UserOptLogPageRequest> pageRequestModel);

    ResultModel updateRole(AdminBooleanRequest booleanRequest);

    //获取用户的关注列表
    ResultModel<List<UserInfoResponse>> queryFans();

    ResultModel<PageResponseModel<UserInfoResponse>> queryFollower(PageRequestModel pageRequestModel);

    //获取我的点赞列表  谁点赞了我的哪一篇帖子
    ResultModel<List<postsFollowResponse>> queryFollowList();

    //获取我的点赞列表 谁点赞了我的哪一条评论
    ResultModel<List<commentFollowResponse>> queryFollowCommentList();

    //邮箱验证码登录
    void sendEmail(String to , String title , String content , String code);

    ResultModel<String> emailLogin(UserRegisterRequest userRegisterRequest) throws Exception;

    //查看用户自己的信息
    ResultModel<UserInfoResponse> querySelfInformation(Long userId);

    //查询用户已经上传的头像的数量是否超过六张
    ResultModel<Boolean> queryAvatarCountService();

    //用户上传头像功能3版本
    ResultModel<String> uploadAvatar3(String avatar);

    //用户删除指定图片
    ResultModel deleteAvatar(String deleteAvatarName);

    //查询上传的图片是否存在
    ResultModel<Boolean> selectSameAvatar(String avatar);

    //获取我点赞的帖子
    ResultModel<PageResponseModel<ArticleLoveResponse>> selectMyLovePosts(Integer pageNo , Integer pageSize) throws Exception;

    //用户举报帖子 评论 或者其它用户
    ResultModel userInformPosts(ArticleInformRequest articleInformRequest);

    //删除用户
    ResultModel deleteUser(Long id);
}
